<?php
//now start to study polymorephism for object desgin
class shopProduct
{
    public $title;
    public $producerFirstName;
    public function getSummaryLine()
    {
        $base = "$this->title";
        $base .= "$this->producerFirstName";
    }
    function readParams($source)//阅读参数   source 资源
    {
        $params = array();
        if (preg_match("/\.xml$/i", $source)) {
            //从$source
        } else {
            //如果不是 Xml格式 就默认为 txt 参数进行读取数据
            //读取参数
        }
        return $params;
        // 返回结果               
    }
    function writeParams($params, $source)
    {
        if (preg_match("/\.xml$/i", $source)) {

        } else {

        }
    }

}
?>